-
-
- 个人中心—视图函数带标签页面参数tag@app.route('/usercenter/<user_id>/<tag>')def usercenter(user_id, tag): if tag == ‘1': return render_template('usercenter1.html', **context)
- 个人中心—导航标签链接增加tag参数<li role=“presentation”><a href=“{ { url_for(‘usercenter’,user_id = user.id,tag = ‘1’) }}">全部问答</a></li>
- 个人中心—有链接到个人中心页面的url增加tag参数u <a href="{ { url_for('usercenter',user_id = session.get('userid'), tag=1) }}">{ { session.get('user') }}</a>
-
{% extends 'base.html' %} {% block title %} 个人中心 {% endblock %} {% block link %} {% endblock %} {% block box %}
-
{% extends 'comment.html' %} {% block subComment %}
- { { foo.author.username }} { { foo.title }} { { foo.creat_time }}
{
{ foo.detail }} {% endfor %}
全部问题
{% for foo in questions %}- { { com.author.username }} { { com.creat_time }}
{
{ com.detail }} {% endfor %}
全部评论
{% for com in comment %}名称: { { user2.username }}
问题数: { { questions|length }}
评论数: { { comment|length }}
- { { foo.author.username }} { { foo.title }} { { foo.creat_time }}
-